<template>
	<view class="my-progress-bar-container">
		<view class="my-progress-bar-inner-container">
			<view class="bar-container" v-for="(item,index) in categoryList" :key="index">
				<view class="bar-left-name-container">{{item.name}}</view>
				<view class="bar-center-container">
					<view class="bar-center-inner-container">
						<view class="bar-center-ratio" :style="{width: item.ratio}"></view>
					</view>
				</view>
				<view class="bar-right-name-container">{{item.num}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			categoryList: {
				type: Array,
				default: () => []
			}
		},
		data(){
			return{
				
			}
		},
		watch:{
		},
		methods:{
			
		},
		mounted() {
		}
	}
</script>

<style scoped lang="scss">
	.bar-charts-box {
		margin: 0rpx !important;
	}
	.my-progress-bar-container{
		width: 100%;
		height: 400rpx;
		// background-color: red;
		margin-top: 0rpx;
		margin: 0rpx;
		padding-bottom: 40rpx;
		box-sizing: border-box;
		
		.my-progress-bar-inner-container {
			width: 100%;
			height: 100%;
			display: flex;
			flex-direction: column;
			
			
			.bar-container {
				width: 100%;
				height: 60rpx;
				margin-bottom: 20rpx;
				display: flex;

				
				.bar-left-name-container {
					width: 20%;
					display: flex;
					justify-content: flex-start;
					align-items: center;
					// word-wrap: break-word; 			// 设置强制换行
					overflow: hidden; 
					font-size: 20rpx;
					padding: 5rpx;
					box-sizing: border-box;
				}
				
				.bar-center-container {
					width: 65%;
					display: flex;
					justify-content: center;
					align-items: center;
					padding: 5rpx;
					box-sizing: border-box;
					
					.bar-center-inner-container {
						width: 100%;
						height: 60%;
						background-color: $themeIconLightGreyColor;
						border-radius: 20rpx;
						position: relative;
						
						.bar-center-ratio {
							height: 100%;
							background-color: #fdc9ca;
							position: absolute;
							left: 0;
							top: 0;
							border-radius: 20rpx;
						}
					}
				}
				
				.bar-right-name-container {
					width: 15%;
					font-size: 25rpx;
					color: $themePurpleColor;
					display: flex;
					justify-content: flex-start;
					align-items: center;
					padding-left: 10rpx;
					box-sizing: border-box;
				}
				
			}
			
		}
		
	}
</style>
